<?php echo $this->translate('rate') . ','.
$this->translate('class name').','.
$this->translate('number').','.
$this->translate('student id').','.
$this->translate('student name').',';
foreach($this->subject as $val) {
    foreach($val as $row){
        if (isset($this->selSubject[$row['subject_sn']])){
            echo $row['name'];
            if ($this->rateCount)
            echo ' X '.$row['rate'];
            echo",";
        }
    }
}
echo $this->translate('total')."\n";

foreach ($this->topList as $row) {
    echo $row['rate'].','.
    $row['class_sn'].','.
    $row['number'].','.
    $row['student_id'].','.
    $row['name'].',';
    $subjectArr = unserialize($row['subject_arr']);
    foreach($this->subject as $val)
    foreach($val as $row2)
    if (isset($this->selSubject[$row2['subject_sn']]))
    if (isset($subjectArr[$row2['subject_sn']]))
    echo $subjectArr[$row2['subject_sn']].',';
    echo $row['score']."\n";
}